﻿namespace Oddo.Concept.Crm.Server.Repository.Business
{
    using System;
    using System.Linq;
    using System.Linq.Expressions;
    using Microsoft.Practices.Unity;
    using Oddo.Concept.Crm.Common.Interfaces;
    using Oddo.Concept.Crm.Models;
    using Oddo.Concept.Crm.Server.Repository.DataAccess;

    public interface ICountryBusiness : IBusiness<Country>
    {
    }

    public class CountryBusiness : BusinessBase<Country>, ICountryBusiness
    {
        [Dependency]
        public ICountryDataAccess DataAccess { get; set; }

        public override IQueryable<Country> Query()
        {
            return DataAccess.Query();
        }

        public override IQueryable<Country> Query(Expression<Func<Country, bool>> predicate)
        {
            return predicate == null ? Query() : DataAccess.Query(predicate);
        }
    }
}